﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using pay.DAL;
using System.Data.SqlClient;
using System.Data;


namespace TG
{
    public class GroupPurchaseConfigBLL
    {
        GroupPurchaseConfigDAL groupPurchaseConfigDAL = new GroupPurchaseConfigDAL();

        /// <summary>
        /// GroupPurchaseConfig对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchaseConfig实体对象</param>
        /// <returns>数据库影响行数</returns>	
        public int Add(GroupPurchaseConfig t)
        {
            return groupPurchaseConfigDAL.Add(t);
        }

        /// <summary>
        /// 根据主键和gid得到一个GroupPurchaseConfig对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchaseConfig对象</returns>
        public GroupPurchaseConfig GroupPurchaseConfig_GetConfig(object id, string gid)
        {
            return groupPurchaseConfigDAL.GroupPurchaseConfig_GetConfig(id, gid);
        }
        /// <summary>
        /// 团购最大数
        /// </summary>
        public int MaxCount
        {
            get
            {
                GroupPurchaseConfig c = GetElementById("MaxCount");
                if (c == null)
                {
                    c = new GroupPurchaseConfig();
                    c.Desc = "最大团购数";
                    c.Key = "MaxCount";
                    c.Value = "300";
                    Add(c);
                }
                return int.Parse(c.Value);
            }
        }

        public DateTime EndDate
        {
            get
            {
                GroupPurchaseConfig c = GetElementById("EndDate");
                return DateTime.Parse(c.Value);
            }
        }

        /// <summary>
        /// 已经购买数
        /// </summary>
        public int Buys
        {
            get
            {
                GroupPurchaseConfig c = GetElementById("Buys");
                if (c == null)
                {
                    c = new GroupPurchaseConfig();
                    c.Desc = "已经购买数";
                    c.Key = "Buys";
                    c.Value = "0";
                    Add(c);
                }
                return int.Parse(c.Value);
            }
        }


        public void BuysAdd()
        {
            //if (Buys >= 400)
            //{
            //    GroupPurchaseConfig c = GetElementById("startTr");
            //    if (c == null)
            //    {
            //        c = new GroupPurchaseConfig();
            //        c.Desc = "增长规律变换时间";
            //        c.Value = DateTime.Now.ToString();
            //        c.Key = "startTr";
            //        Add(c);
            //    }
            //    var endDate = DateTime.Parse("2010-11-12 23:59:59");
            //    var startDate = DateTime.Parse(c.Value);
            //    //秒
            //    var totalJg = (int)(endDate - startDate).TotalSeconds;
            //    var jg = totalJg / 100;
            //    int result= (int)((DateTime.Now-startDate).TotalSeconds/jg)+400;

            //    GroupPurchaseConfig ag = new GroupPurchaseConfig();
            //    ag.Desc = "已经购买数";
            //    ag.Key = "Buys";
            //    ag.Value = result.ToString();
            //    Update(ag);
            //}
            if (Buys >= 494)
            {
                return;
            }
            GroupPurchaseConfig g = new GroupPurchaseConfig();
            g.Desc = "已经购买数";
            g.Key = "Buys";
            g.Value = (Buys + 1).ToString();
            Update(g);

        }


        /// <summary>
        /// 更新GroupPurchaseConfig实体
        /// </summary>
        /// <param name="t">要更新的GroupPurchaseConfig对象</param>
        /// <returns>数据库影响行数</returns>
        public int Update(GroupPurchaseConfig t)
        {
            return groupPurchaseConfigDAL.Update(t);
        }

        /// <summary>
        /// 删除GroupPurchaseConfig对象
        /// </summary>
        /// <param name="t">要删除的GroupPurchaseConfig对象</param>
        /// <returns>数据库影响的行数</returns>
        public int Delete(GroupPurchaseConfig t)
        {
            return groupPurchaseConfigDAL.Delete(t);
        }

        /// <summary>
        /// 根据主键得到一个GroupPurchaseConfig对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchaseConfig对象</returns>
        public GroupPurchaseConfig GetElementById(object id)
        {
            return groupPurchaseConfigDAL.GetElementById(id);
        }


    }

    public class GroupPurchaseConfigDAL
    {
        /// <summary>
        /// GroupPurchaseConfig对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchaseConfig实体对象</param>
        /// <returns>数据库影响行数</returns>
        public int Add(GroupPurchaseConfig t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("key", SqlDbType.VarChar, 50, t.Key);
                tool.AddSqlParameter("value", SqlDbType.VarChar, 100, t.Value);
                tool.AddSqlParameter("desc", SqlDbType.VarChar, 100, t.Desc);
                tool.AddSqlParameter("gid", SqlDbType.Int, 4, t.Gid);
                tool.AddSqlParameter("flag", SqlDbType.VarChar, 6, "add");
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_Add_Update", tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 更新GroupPurchaseConfig实体
        /// </summary>
        /// <param name="t">要更新的GroupPurchaseConfig对象</param>
        /// <returns>数据库影响行数</returns>
        public int Update(GroupPurchaseConfig t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("key", SqlDbType.VarChar, 50, t.Key);
                tool.AddSqlParameter("value", SqlDbType.VarChar, 100, t.Value);
                tool.AddSqlParameter("desc", SqlDbType.VarChar, 100, t.Desc);
                tool.AddSqlParameter("gid", SqlDbType.VarChar, t.Gid);
                tool.AddSqlParameter("flag", SqlDbType.VarChar, 6, "update");
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_Add_Update", tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 删除GroupPurchaseConfig对象
        /// </summary>
        /// <param name="t">要删除的GroupPurchaseConfig对象</param>
        /// <returns>数据库影响的行数</returns>
        public int Delete(GroupPurchaseConfig t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("key", SqlDbType.VarChar, 50, t.Key);
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_DeleteById", tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 根据主键得到一个GroupPurchaseConfig对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchaseConfig对象</returns>
        public GroupPurchaseConfig GetElementById(object id)
        {
            SqlDataReader reader = null;
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("key", SqlDbType.VarChar, 50, id);
                reader = Emoney.DataAccess.SqlHelper.ExecuteReader(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_GetElementById", tool.GetSqlParameters());
                GroupPurchaseConfig m = null;
                if (reader.Read())
                {
                    m = new GroupPurchaseConfig();
                    m.Key = Tools.GetString(reader["key"]);
                    m.Value = Tools.GetString(reader["value"]);
                    m.Desc = Tools.GetString(reader["desc"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                }
                return m;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }



        /// <summary>
        /// 根据主键和gid得到一个GroupPurchaseConfig对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchaseConfig对象</returns>
        public GroupPurchaseConfig GroupPurchaseConfig_GetConfig(object id, string gid)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("key", SqlDbType.VarChar, 50, id);
                tool.AddSqlParameter("gid", SqlDbType.VarChar, 50, gid);
                DataTable tb = Emoney.DataAccess.SqlHelper.ExecuteDataset(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_GetConfig", tool.GetSqlParameters()).Tables[0];
                GroupPurchaseConfig m = null;
                if (tb.Rows.Count > 0)
                {
                    DataRow reader = tb.Rows[0];
                    m = new GroupPurchaseConfig();
                    m.Key = Tools.GetString(reader["key"]);
                    m.Value = Tools.GetString(reader["value"]);
                    m.Desc = Tools.GetString(reader["desc"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                }
                return m;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// GroupPurchaseConfig表分页
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageCount">一页显示多少行</param>
        /// <param name="count">总记录数</param>
        /// <returns>GroupPurchaseConfig对象的集合</returns>
        public List<GroupPurchaseConfig> Paging(int pageIndex, int pageCount, out int count)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("@pageIndex", SqlDbType.Int, pageIndex);
                tool.AddSqlParameter("@pageCount", SqlDbType.Int, pageCount);
                tool.AddSqlParameter("count", SqlDbType.Int, ParameterDirection.Output);
                DataSet ds = Emoney.DataAccess.SqlHelper.ExecuteDataset(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchaseConfig_Paging", tool.GetSqlParameters());
                count = (int)tool.GetSqlParameterByName("count").Value;
                DataTable tb = ds.Tables[0];
                List<GroupPurchaseConfig> lst = new List<GroupPurchaseConfig>();
                foreach (DataRow reader in tb.Rows)
                {
                    GroupPurchaseConfig m = new GroupPurchaseConfig();
                    m.Key = Tools.GetString(reader["key"]);
                    m.Value = Tools.GetString(reader["value"]);
                    m.Desc = Tools.GetString(reader["desc"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                    lst.Add(m);
                }
                return lst;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class GroupPurchaseBLL
    {
    
        GroupPurchaseDAL groupPurchaseDAL = new GroupPurchaseDAL();

        /// <summary>
        /// GroupPurchase对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchase实体对象</param>
        /// <returns>数据库影响行数</returns>	
        public int Add(GroupPurchase t)
        {
            return groupPurchaseDAL.Add(t);
        }
        /// <summary>
        /// GroupPurchase对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchase实体对象</param>
        /// <returns>主键id</returns>	
        public int AddGp(GroupPurchase t)
        {
            return groupPurchaseDAL.AddGp(t);
        }
        /// <summary>
        /// 更新GroupPurchase实体
        /// </summary>
        /// <param name="t">要更新的GroupPurchase对象</param>
        /// <returns>数据库影响行数</returns>
        public int Update(GroupPurchase t)
        {
            return groupPurchaseDAL.Update(t);
        }
        /// <summary>
        /// 根据主键得到一个GroupPurchase对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchase对象</returns>
        public GroupPurchase GroupPurchase_Emcarid_gid(object id, string gid)
        {
            return groupPurchaseDAL.GroupPurchase_Emcarid_gid(id, gid);
        }

        /// <summary>
        /// 删除GroupPurchase对象
        /// </summary>
        /// <param name="t">要删除的GroupPurchase对象</param>
        /// <returns>数据库影响的行数</returns>
        public int Delete(GroupPurchase t)
        {
            return groupPurchaseDAL.Delete(t);
        }

        /// <summary>
        /// 根据主键得到一个GroupPurchase对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchase对象</returns>
        public GroupPurchase GetElementById(object id)
        {
            return groupPurchaseDAL.GetElementById(id);
        }

        //public GroupPurchase g(object id,string gid)
        //{
        //    return groupPurchaseDAL
        //}

        public List<GroupPurchase> Paging(int pageIndex, int pageCount, out int count)
        {
            return groupPurchaseDAL.Paging(pageIndex, pageCount, out count);
        }

    }

    public class GroupPurchaseDAL
    {
        /// <summary>
        /// GroupPurchase对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchase实体对象</param>
        /// <returns>数据库影响行数</returns>
        public int Add(GroupPurchase t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("id", SqlDbType.Int, 4, t.Id);
                tool.AddSqlParameter("ctime", SqlDbType.DateTime, 8, t.Ctime);
                tool.AddSqlParameter("EmCarid", SqlDbType.NVarChar, 100, t.EmCarid);
                tool.AddSqlParameter("name", SqlDbType.VarChar, 50, t.Name);
                tool.AddSqlParameter("phone", SqlDbType.VarChar, 20, t.Phone);
                tool.AddSqlParameter("tel", SqlDbType.VarChar, 20, t.Tel);
                tool.AddSqlParameter("address", SqlDbType.VarChar, 100, t.Address);
                tool.AddSqlParameter("Region", SqlDbType.VarChar, 100, t.Region);
                tool.AddSqlParameter("code", SqlDbType.VarChar, 20, t.Code);
                tool.AddSqlParameter("source", SqlDbType.VarChar, 50, t.Source);
                tool.AddSqlParameter("ischeck", SqlDbType.Bit, 1, t.Ischeck);
                tool.AddSqlParameter("gid", SqlDbType.VarChar, 50, t.Gid);
                tool.AddSqlParameter("flag", SqlDbType.VarChar, 6, "add");
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchase_Add_Update", tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                LogYuMin.LogWriter.GetWriter(LogYuMin.LogFile.error).Write(GetType(), "GroupPurchaseDAL.Add(GroupPurchase t)", LogYuMin.LogStates.ERROR, ex.StackTrace);
                return 0;
            }
        }

        /// <summary>
        /// GroupPurchase对象的添加方法
        /// </summary>
        /// <param name="t">GroupPurchase实体对象</param>
        /// <returns>数据库影响行数</returns>
        public int AddGp(GroupPurchase t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("id", SqlDbType.Int, 4, t.Id);
                tool.AddSqlParameter("ctime", SqlDbType.DateTime, 8, t.Ctime);
                tool.AddSqlParameter("EmCarid", SqlDbType.NVarChar, 100, t.EmCarid);
                tool.AddSqlParameter("name", SqlDbType.VarChar, 50, t.Name);
                tool.AddSqlParameter("phone", SqlDbType.VarChar, 20, t.Phone);
                tool.AddSqlParameter("tel", SqlDbType.VarChar, 20, t.Tel);
                tool.AddSqlParameter("address", SqlDbType.VarChar, 100, t.Address);
                tool.AddSqlParameter("Region", SqlDbType.VarChar, 100, t.Region);
                tool.AddSqlParameter("code", SqlDbType.VarChar, 20, t.Code);
                tool.AddSqlParameter("source", SqlDbType.VarChar, 50, t.Source);
                tool.AddSqlParameter("ischeck", SqlDbType.Bit, 1, t.Ischeck);
                tool.AddSqlParameter("gid", SqlDbType.VarChar, 50, t.Gid);
                tool.AddSqlParameter("flag", SqlDbType.VarChar, 6, "add");
                string sql = "insert into [GroupPurchase] ([ctime],[EmCarid],[name],[phone],[tel],[address],[Region],[code],[source],[ischeck],[gid]) values(@ctime,@EmCarid,@name,master.dbo.fn_encrypt( @phone),master.dbo.fn_encrypt(@tel),@address,@Region,@code,@source,@ischeck,@gid);select @@identity";
                return int.Parse(Emoney.DataAccess.SqlHelper.ExecuteScalar(DBConn.Con_emweb_new, CommandType.Text, sql, tool.GetSqlParameters()).ToString());
            }
            catch (Exception ex)
            {
                LogYuMin.LogWriter.GetWriter(LogYuMin.LogFile.error).Write(GetType(), "GroupPurchaseDAL.Add(GroupPurchase t)", LogYuMin.LogStates.ERROR, ex.StackTrace);
                return 0;
            }
        }

        /// <summary>
        /// 更新GroupPurchase实体
        /// </summary>
        /// <param name="t">要更新的GroupPurchase对象</param>
        /// <returns>数据库影响行数</returns>
        public int Update(GroupPurchase t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("id", SqlDbType.Int, 4, t.Id);
                tool.AddSqlParameter("ischeck", SqlDbType.Bit, 1, t.Ischeck);
                string sql = "update [GroupPurchase] set [ischeck]=@ischeck where [id]=@id ";
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.Text, sql, tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 删除GroupPurchase对象
        /// </summary>
        /// <param name="t">要删除的GroupPurchase对象</param>
        /// <returns>数据库影响的行数</returns>
        public int Delete(GroupPurchase t)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("id", SqlDbType.Int, 4, t.Id);
                return Emoney.DataAccess.SqlHelper.ExecuteNonQuery(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchase_DeleteById", tool.GetSqlParameters());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 根据主键得到一个GroupPurchase对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchase对象</returns>
        public GroupPurchase GetElementById(object id)
        {
            SqlConnection con = null;
            SqlDataReader reader = null;
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("id", SqlDbType.Int, 4, id);

                reader = Emoney.DataAccess.SqlHelper.ExecuteReader(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchase_GetElementById", tool.GetSqlParameters());
                GroupPurchase m = new GroupPurchase();
                if (reader.Read())
                {
                    m.Id = Tools.GetInt(reader["id"]);
                    m.Ctime = Tools.GetDateTime(reader["ctime"]);
                    m.Phone = Tools.GetString(reader["phone"]);
                    m.Code = Tools.GetString(reader["code"]);
                    m.Source = Tools.GetString(reader["source"]);
                    m.Ischeck = Tools.GetInt(reader["ischeck"]);
                    m.Name = Tools.GetString(reader["name"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                }
                return m;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (con != null)
                {
                    con.Close();
                }
            }
        }

        /// <summary>
        /// 根据主键得到一个GroupPurchase对象
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>GroupPurchase对象</returns>
        public GroupPurchase GroupPurchase_Emcarid_gid(object id, string gid)
        {
            SqlConnection con = null;
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("EmCarid", SqlDbType.VarChar, 50, id);
                tool.AddSqlParameter("gid", SqlDbType.VarChar, 50, gid);
                DataTable tb = Emoney.DataAccess.SqlHelper.ExecuteDataset(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchase_Emcarid_gid", tool.GetSqlParameters()).Tables[0];
                GroupPurchase m = null;
                if (tb.Rows.Count > 0)
                {
                    m = new GroupPurchase();
                    DataRow reader = tb.Rows[0];
                    m.Id = Tools.GetInt(reader["id"]);
                    m.Ctime = Tools.GetDateTime(reader["ctime"]);
                    m.Phone = Tools.GetString(reader["phone"]);
                    m.Code = Tools.GetString(reader["code"]);
                    m.Source = Tools.GetString(reader["source"]);
                    m.Ischeck = Tools.GetInt(reader["ischeck"]);
                    m.Name = Tools.GetString(reader["name"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                }
                return m;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }


        /// <summary>
        /// GroupPurchase表分页
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageCount">一页显示多少行</param>
        /// <param name="count">总记录数</param>
        /// <returns>GroupPurchase对象的集合</returns>
        public List<GroupPurchase> Paging(int pageIndex, int pageCount, out int count)
        {
            try
            {
                Tools tool = new Tools();
                tool.AddSqlParameter("@pageIndex", SqlDbType.Int, pageIndex);
                tool.AddSqlParameter("@pageCount", SqlDbType.Int, pageCount);
                tool.AddSqlParameter("count", SqlDbType.Int, ParameterDirection.Output);
                DataSet ds = Emoney.DataAccess.SqlHelper.ExecuteDataset(DBConn.Con_emweb_new, CommandType.StoredProcedure, "GroupPurchase_Paging", tool.GetSqlParameters());
                count = (int)tool.GetSqlParameterByName("count").Value;
                DataTable tb = ds.Tables[0];
                List<GroupPurchase> lst = new List<GroupPurchase>();
                foreach (DataRow reader in tb.Rows)
                {
                    GroupPurchase m = new GroupPurchase();
                    m.Id = Tools.GetInt(reader["id"]);
                    m.Ctime = Tools.GetDateTime(reader["ctime"]);
                    m.Phone = Tools.GetString(reader["phone"]);
                    m.Code = Tools.GetString(reader["code"]);
                    m.Source = Tools.GetString(reader["source"]);
                    m.Ischeck = Tools.GetInt(reader["ischeck"]);
                    m.Name = Tools.GetString(reader["name"]);
                    m.Gid = Tools.GetString(reader["gid"]);
                    lst.Add(m);
                }
                return lst;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }


    public class GroupPurchaseConfig
    {
        /// <summary>
        /// 
        /// </summary>
        public string Key
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Value
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Desc
        {
            get;
            set;
        }

        public string Gid
        {
            get;
            set;
        }
    }

    public class GroupPurchase
    {
        /// <summary>
        /// 
        /// </summary>
        public int? Id
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public DateTime? Ctime
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string EmCarid
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Phone
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Tel
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Address
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Region
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Code
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Source
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public int? Ischeck
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Gid
        {
            get;
            set;
        }


    }
}